package com.ikas.ai.enums;

/**
 * @Description: 节点类型
 * @Author: qi.yilai
 * @Date: 2022/8/10 16:55
 * @Version: 1.0.0
 **/
public enum NodeTypeEnum {

    READ_DATA(1,"read_data", "数据读取"),

    VARIABLE_SET(2,"variable_set", "变量设定"),

    DATA_PARTITION(3,"data_partition", "数据分割"),

    FITTING_OF_POLYNOMIAL(4,"fitting_of_polynomial", "多项式拟合"),

    PREDICTOR_AND_SCORER(5,"predictor_and_scorer", "回归预测"),

    PARAM_WARN(6,"param_warn", "参数预警"),

    WARN_VERIFY(7,"warn_verify", "预警验证"),

    LINEAR_REGRESSION(8,"linear_regression", "线性回归"),

    RANDOM_FOREST_REGRESSION(9,"random_forest_regression", "随机森林回归"),

    NULL_HANDLE(10,"null_handle", "空值处理"),

    MODEL_IMPORT(11,"model_input", "模型导入"),

    MODEL_STORE(12,"model_store", "模型存储"),

    NOISE_DATA_PROCESS(13,"noise_data_process", "噪音数据处理"),

    CORRELATION_COEFFICIENT_FEATURE_EXTRACTION(14,"correlation_coefficient_feature_extraction", "相关系数特征筛选"),

    TIME_RESAMPLE(15,"time_resample", "时间重采样"),

    TABLE_PIVOT(16,"table_pivot", "表格透视"),

    RANDOM_FOREST_CLASSIFICATION(17,"random_forest_classification", "随机森林分类"),

    CLASSIFICATION_FORECAST(18,"classification_forecast", "分类预测"),

    DATA_CONCAT(19,"data_concat", "数据拼接"),

    STAMP_TO_DATETIME(20,"stamp_to_datetime", "时间戳 (int64) 转日期时间类型组件"),

    DATA_MERGE(21,"data_merge", "数据合并"),

    STR_TO_DATETIME(22,"str_to_datetime", "字符串类型转日期时间类型"),

    DATA_FILTER(23,"data_filter", "数据过滤/行过滤"),

    CORRELATION_COEFFICIENT_APPLY(24,"correlation_coefficient_apply", "相关系数过滤应用组件"),

    KAFKA_INPUT(25,"kafka_input", "kafka输入"),

    KAFKA_OUTPUT(26,"kafka_out", "kafka输出"),

    SUB_FLOW(44, "sub_flow", "子流程");

    private int id;

    private String code;

    private String nodeName;

    NodeTypeEnum(int id, String code, String nodeName) {
        this.id = id;
        this.code = code;
        this.nodeName = nodeName;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public static NodeTypeEnum of(String nodeTypeCode) {
        for (NodeTypeEnum nodeTypeEnum : NodeTypeEnum.values()) {
            if (nodeTypeEnum.getCode().equals(nodeTypeCode)) {
                return nodeTypeEnum;
            }
        }
        return null;
    }
}
